package cn.itcast.bos.Service;

import cn.itcast.crm.domain.Customer;

import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import java.awt.*;
import java.util.List;

//@Path("customerService")
//@Produces("*/*")
public interface CustomerService{
     //查询m没有关联定区的客户
     @Path("/noAssociationCustomer")
     @GET
     @Produces({"application/xml","application/json"})
     List<Customer> findNoAssociationCustomers();
     //查询关联定区的客户
     @Path("/hasAssociationFixedAreaCustomers/{fixedAreaId}")
     @GET
     @Produces({"application/xml","application/json"})
     List<Customer> findHasAssociationFixedAreaCustomers(@PathParam("fixedAreaId") String fixedAreaId);
     //修改客户绑定定区的方法
     @Path("/associationCustomersToFixedArea")
     @PUT
     void associationCustomersToFixedArea(@QueryParam("customerId") String customerId ,
                                          @QueryParam("fixedAreaId") String fixedAreaId);

     void save(Customer c);
     //注册客户的方法
     @Path("/registCustomer")
     @POST
    @Consumes({"application/xml","application/json"})
     void registCustomer(Customer customer);
     //查询是否已经绑定过邮箱的方法
     @Path("customerByTelephone/{telephone}")
     @GET
     @Consumes({"application/xml","application/json"})
     Customer findByTelephone(@PathParam("telephone") String telephone);
     //绑定邮箱的方法
     @Path("/customerUpdteType")
     @PUT
     void UpdateTypeByTelephone(@QueryParam("telephone") String telephone);
     //验证登陆的方法
    @Path("login")
    @GET
    @Consumes({"application/xml","application/json"})
    @Produces({"application/xml","application/json"})
    Customer loginbyUsername(@QueryParam("username") String username,@QueryParam("password") String password);
    //根据发货地址查询匹配的客户分区地址
    @Path("findFixedAreaIdByAddress")
    @GET
    @Consumes({"application/xml","application/json"})
    String fixidAreaID(@QueryParam("address") String address);

}
